package action;

import bean.User;
import com.opensymphony.xwork2.ActionSupport;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

/**
 * 支持ajax的Action
 */
public class ajaxLoginAction extends ActionSupport{
    private User user;
    private InputStream inputStream;
    @Override
    public String execute() throws Exception {
        String name = getUser().getName();
        inputStream = new ByteArrayInputStream(("登录成功,欢迎"+name).getBytes());
        return SUCCESS;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public InputStream getInputStream() {
        return inputStream;
    }

    public void setInputStream(InputStream inputStream) {
        this.inputStream = inputStream;
    }
}
